package com.onpositive.wiki3.db.impl;

import java.io.BufferedInputStream;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.util.ArrayList;
import java.util.Collections;

import com.onpositive.wiki3.db.impl.CountingVocabalary.Pair;


public class Test1 {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		try{
		DataInputStream str=new DataInputStream(new BufferedInputStream(new FileInputStream("C:/work/content/props/props.dt")));
		CountingVocabalary vm=new CountingVocabalary();
		try{
		while (str.available()>=0){
			
			String readUTF = str.readUTF();
			if (readUTF==null){
				break;
			}
			vm.add(readUTF);
			str.readInt();
			str.readUTF();
		}
		}catch (Exception e) {
			// TODO: handle exception
		}
		ArrayList<Pair> all = vm.all();
		Collections.sort(all);
		Collections.reverse(all);
		for(Pair p:all){
			System.out.println(p);
		}
		}catch (Exception e) {
			e.printStackTrace();
			// TODO: handle exception
		}
	}

}
